def isge(x):
    if 0 <= x < 10:
        return "0" + str(x)
    return str(x)

s, v = map(int, input().split())
div, mod = divmod(s, v)
if mod != 0:
    div += 1
div += 10
h, m = divmod(div, 60)
if m != 0:
    h += 1
hour = 8 - h
min = 60 - m
if hour < 0:
    hour += 24
print("%s:%s" % (isge(hour), isge(min)))
